package com.chen.webservice.Utils;

import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: 可添加不同的约束规则，放进 ruleHandleMap
 * @params:
 * @return:
 * @author: chenzhiwen
 * @dateTime: 2021/10/21 下午7:16
 */
@Service
public class RuleChain {

    public static List<RuleHandler> ruleHandleChain = new ArrayList<>();
    // TODO forceCheckList什么用途？？？？
    public static List<Integer> forceCheckList = new ArrayList<>();//强校验约束条件

    private static final CategoryTypeHandler categoryTypeHandler = new CategoryTypeHandler();
    private static final PropertyHandler propertyHandler = new PropertyHandler();
    private static final CarHandler carHandler = new CarHandler();
    private static final CoverHandler coverHandler = new CoverHandler();
    private static final Weak101Handler weak101Handler = new Weak101Handler();
    private static final Weak102Handler weak102Handler = new Weak102Handler();
    private static final Weak103Handler weak103Handler = new Weak103Handler();
    private static final Weak104Handler weak104Handler = new Weak104Handler();
//
//    @Autowired
//    public static CategoryTypeHandler categoryTypeHandler;

    //    @PostConstruct
    static {
        RuleChain.ruleHandleChain.add(categoryTypeHandler);
        RuleChain.ruleHandleChain.add(propertyHandler);
        RuleChain.ruleHandleChain.add(carHandler);
        RuleChain.ruleHandleChain.add(coverHandler);
        RuleChain.ruleHandleChain.add(weak101Handler);
        RuleChain.ruleHandleChain.add(weak102Handler);
        RuleChain.ruleHandleChain.add(weak103Handler);
        RuleChain.ruleHandleChain.add(weak104Handler);
    }

}
